package priv.yiyuan.example.design;

/**
 * windows 文件系统 适配器
 *
 * @author YiYuan
 * @data 2025/8/8
 * @apoNote
 */
public class WindowsFileSystemAdapter implements FileSystem {

    private final WindowsNativeFileSystem windowsFileSystem;

    public WindowsFileSystemAdapter(WindowsNativeFileSystem windowsFileSystem) {
        this.windowsFileSystem = windowsFileSystem;
    }

    @Override
    public void createFile(String path) {
        windowsFileSystem.removeFile(path);
    }

    @Override
    public void deleteFile(String path) {
        windowsFileSystem.removeFile(path);
    }

    @Override
    public String readFile(String path) {
        return windowsFileSystem.readFileContent(path);
    }

    @Override
    public void writeFile(String path, String content) {
        windowsFileSystem.writeToFile(path, content);
    }

    @Override
    public String getFileInfo(String path) {
        return windowsFileSystem.getFileMetadata(path);
    }
}
